package Package.Test.Test1;

import Package.Test.Test1.test_1_1.Student;

import java.util.HashMap;
import java.util.Set;

public class Test_1_1 {
    public static final void Test_1_1(){
        HashMap<Student, String> hm=new HashMap<Student,String>();
        Student s1 = new Student("林青霞", 30,15,true);
        Student s2 = new Student("张曼玉", 35,16,false);
        Student s3 = new Student("王祖贤", 33,18,true);
        Student s4 = new Student("王祖贤", 33,20,false);
//把学生添加到集合
        hm.put(s1,"China");
        hm.put(s2,"usa");
        hm.put(s3,"England");
        hm.put(s4,"Rusia");
        Set<Student> keyset=hm.keySet();
        for (Student stu:keyset
        ) {
            System.out.println(hm.get(stu));
        }
    }
}
